package com.book.exception;

import com.book.util.JsonResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author SuperYu  2024/8/14
 */
@RestControllerAdvice
public class MyExceptionHandler {

    @ExceptionHandler(NoLoginException.class)
    public JsonResult noLogin(NoLoginException e){
        return JsonResult.build(408,e.getMessage(),null);
    }

}
